<?php

	session_start();
	
	/*
	Info: This file handles the delete button for the entry lines
	Author: Pritam Pebam
	Version: 1.0
	Contact: ptamzz@gmail.com; @ptamzz
	URL: http://12bubbles.com
	*/
	
	require_once('../inc/fnc.php');
	require_once('../inc/conn.php');
	
	// Initializing variables
	$delId = $_POST['btnId'];
	$lineId = $_POST['lineId'];
	$storyId = $_POST['storyId'];
	
	$userId = $_SESSION['userId'];
	$node = "new" . $delId;
	$time = time();
	
	// Soft deleting entry line
	$query = "UPDATE entryline SET delflag = 'Y' WHERE `storyid` = {$storyId} and displayseq = '{$lineId}' and delflag = 'N'";
	if(mysql_query($query,$connection)) {
		if(mysql_query("UPDATE notification SET delflag = 'Y' WHERE storyid = {$storyId} AND uniqueentryid = '{$lineId}' and delflag = 'N'")){
			$return['type'] = 'true';
		} else {
			$return['type'] = 'false';
		}
	} else {
		$return['type'] = 'false';
	}
	echo json_encode($return);
?>